// verify_vector_store_path.js - 验证向量存储路径
import path from 'path';
import fs from 'fs';
import { fileURLToPath } from 'url';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

// 模拟vectorStoreService.js中的路径计算
const servicesDir = path.resolve(__dirname, 'services');
const VECTOR_STORE_PATH = path.join(servicesDir, '../vector_store');

console.log('Simulated servicesDir:', servicesDir);
console.log('Simulated VECTOR_STORE_PATH:', VECTOR_STORE_PATH);
console.log('Path exists:', fs.existsSync(VECTOR_STORE_PATH));

// 检查实际的vector_store目录
const actualVectorStorePath = path.join(__dirname, 'vector_store');
console.log('Actual vector store path:', actualVectorStorePath);
console.log('Actual path exists:', fs.existsSync(actualVectorStorePath));

if (fs.existsSync(actualVectorStorePath)) {
    const files = fs.readdirSync(actualVectorStorePath);
    console.log('Files in actual vector store:', files);
}